import 'package:flutter/cupertino.dart';
import 'package:online_study/bean/recommend.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

class RecommendItem extends StatefulWidget {
  Recommend recommend;

  RecommendItem(this.recommend);

  @override
  _RecommendItemState createState() => _RecommendItemState(recommend);
}

class _RecommendItemState extends State<RecommendItem> {
  Recommend recommend;

  _RecommendItemState(this.recommend);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: ThemeSize.height188,
      padding: EdgeInsets.only(bottom: ThemeSize.height14),
      decoration: BoxDecoration(
          color: ThemeColor.colorWhite,
          borderRadius: BorderRadius.all(Radius.circular(ThemeSize.width9))),
      child: Column(
        crossAxisAlignment:CrossAxisAlignment.start,
        children: [
          Expanded(child: Container(
            height: ThemeSize.height130,
            decoration: BoxDecoration(
                borderRadius:
                BorderRadius.all(Radius.circular(ThemeSize.width9)),
                image: DecorationImage(
                    image: NetworkImage(
                        "https://flutter.github.io/assets-for-api-docs/assets/widgets/puffin.jpg"),
                    fit: BoxFit.cover)),
          ),),
          Container(
              padding: EdgeInsets.only(left:ThemeSize.width9,top: ThemeSize.height14),
              child: Text(recommend.title,
                  style: TextStyle(
                      color: ThemeColor.color333333,
                      fontSize: ThemeSize.sp14,
                      fontWeight: FontWeight.bold))),
          Container(
            padding: EdgeInsets.symmetric(horizontal:ThemeSize.width9),
            child: Text(recommend.des,
                style: TextStyle(
                    color: ThemeColor.color333333, fontSize: ThemeSize.sp14)),
          )
        ],
      ),
    );
  }
}
